package common;

import cn.hutool.core.bean.BeanException;
import org.example.factory.ConfigurableListableBeanFactory;
import org.example.factory.config.BeanDefinition;
import org.example.factory.config.BeanFactoryPostProcessor;
import org.example.property.PropertyValue;
import org.example.property.PropertyValues;

/**
 * @Author: luyg
 * @Date: 2024/09/08/17:40
 * @Description:
 */
public class MyBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeanException {

        BeanDefinition beanDefinition = beanFactory.getBeanDefinition("userService");
        PropertyValues propertyValues = beanDefinition.getPropertyValues();

        propertyValues.addPropertyValue(new PropertyValue("company", "改为：字节跳动"));
    }
}
